package com.woniuxy.service.impl;

import com.woniuxy.dao.RelationshipDao;
import com.woniuxy.entity.Relationship;
import com.woniuxy.service.RelationshipService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Transactional
@Data
@Service
public class RelationshipServiceImpl implements RelationshipService {

    @Autowired
    private RelationshipDao relationshipDao;

    /**
     * 根据场馆ID 查询有哪些关注者
     * @param venueId venue
     * @return List<Relationship>
     */
    @Override
    public List<Relationship> findFansByVenueId(int venueId) {
        return relationshipDao.findFansByVenueId(venueId);
    }

    /** 根据场馆ID 查询他关注了谁
     * @param venueId venue
     * @return List<Relationship>
     */
    @Override
    public List<Relationship> findFollowedByVenueId(int venueId) {
        return relationshipDao.findFollowedByVenueId(venueId);
    }

}
